package com.ac.scum.log.web.model.ftp.manager;

import com.ac.scum.log.web.utils.ftp.FTPUtil;
import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class FtpSessionManager {
    private final Map<String, FTPUtil> sessionFtpClientMap = new ConcurrentHashMap<>();

    public void addSessionFtpClient(String sessionId, FTPUtil ftpUtil) {
        sessionFtpClientMap.put(sessionId, ftpUtil);
    }

    public FTPUtil getSessionFtpClient(String sessionId) {
        return sessionFtpClientMap.get(sessionId);
    }

    public void removeSessionFtpClient(String sessionId) {
        sessionFtpClientMap.remove(sessionId);
    }
}